<script>
/* 获取钱包详情 */
import { _getWallet } from "@/lib/api/walletServer/info";
/*  */
import { mapMutations } from "vuex"; 
export default {
    methods:{
		/* 钱包余额 */
        ...mapMutations("wallet", ["setBalance", "setIntegral"]),
        /*  */
        async _getWallet(){
            if(uni.getStorage('userInfo')){
                
                try {
                    const res = await _getWallet({
                        showLoading:false
                    });
                    console.log("余额积分信息---",res);
                    let {
                        creditTotal = 0,  //积分
                        moneyTotal = 0    //余额
                    } = res.data;
                    this.setIntegral(creditTotal);
                    this.setBalance(this.ZZaddNumZero(moneyTotal));
                    return Promise.resolve(res.data);
                } catch (error) {
                    console.log(error);
                }
            }
            return Promise.resolve();
        }
    }
}
</script>